<template>
  <el-menu
    default-active="2"
    class="el-menu-vertical-demo"
    background-color="#545c64"
    text-color="#fff"
    active-text-color="#ffd04b"
    :collapse="isCollapse"
  >
    <h3 v-show="isCollapse">文书</h3>
    <h3 v-show="!isCollapse">智能法律文书后台系统</h3>
    <el-submenu
      :index="item.label"
      v-for="(item, index) in asideMenu"
      :key="index"
    >
      <template slot="title">
        <i :class="'el-icon-' + item.icon"></i>
        <span slot="title">{{ item.label }}</span>
      </template>
      <el-menu-item-group>
        <el-menu-item
          :index="subItem.path"
          v-for="(subItem, subIndex) in item.children"
          :key="subIndex"
          @click="clickMenu(subItem)"
        >
          <i :class="'el-icon-' + subItem.icon"></i>
          <span slot="title">{{ subItem.label }}</span>
        </el-menu-item>
      </el-menu-item-group>
    </el-submenu>
  </el-menu>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: false,
      asideMenu: [
        {
          label: "信息录入",
          icon: "edit",
          children: [
            {
              path: "/information_abc",
              name: "Information_ABC",
              label: "农行",
              icon: "bangzhu",
            },
            {
              path: "/information_gdb",
              name: "Information_GDB",
              label: "广发",
              icon: "trophy",
            },
            {
              path:"/information_pa",
              name:"Information_PA",
              label:"平安",
              icon: "key"
            }
          ],
        },
        {
          label: "文书生成",
          icon: "notebook-2",
          children: [
            {
              path: "/document_abc",
              name: "Document_ABC",
              label: "农行",
              icon: "bangzhu",
            },
            {
              path: "/document_gdb",
              name: "Document_GDB",
              label: "广发",
              icon: "trophy",
            },
              {
              path:"/document_pa",
              name:"Document_PA",
              label:"平安",
              icon: "key"
            }
          ],
        },
        {
          label: "其它",
          icon: "s-comment",
          children: [
            {
             path: "/others",
             name: "Others",
             label: "操作指南下载",
             icon: "s-comment",
            }
           
          ],
        },
      ],
    };
  },
  methods: {
    clickMenu(item) {
      // console.log(item.path)
      // console.log(this.$route)
      if (item.path != this.$route.path) {
        this.$router.push({ name: item.name }); //路由跳转
        console.log("success");
      }

      // console.log('点击成功')
    },
  },
  computed: {
    //     isCollapse() {
    //   return this.$store.state.isCollapse
    // },
  },
};
</script>

 <style lang="scss" scoped>
.el-menu {
  height: 100%;
  border: none;
  h3 {
    color: #ffffff;
    text-align: center;
    line-height: 48px;
  }
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
</style>
    
  
    
  

 

 



